<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        .wp {
            width: 500px;
            background-color: blue;
            color: #fff;
            text-align: center;
            padding: 20px;
            margin: 100px;
        }
        
        .text-info {
            width: 100%;
            margin-bottom: 30px;
        }
        
        .text-info>div:nth-child(1) {
            float: left;
        }
        
        .text-info>div:nth-child(2) {
            float: right;
        }
        
        .text-info>div:nth-child(2)>span {
            color: red;
        }
        
        textarea {
            width: 100%;
            height: 80px;
        }
        
        button.publish {
            height: 30px;
            width: 90px;
            margin-top: 20px;
            outline: none;
            background-color: purple;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        
        .content {
            border-bottom: 1px dotted #ccc;
            overflow: hidden;
            height: 50px;
            line-height: 50px;
        }
        
        .content>p {
            float: left;
        }
        
        .content>button {
            float: right;
            cursor: pointer;
            margin-top: 15px;
        }
    </style>
</head>

<body>
    <div class="wp">
        <div class="text-info">
            <div>有什么新鲜事告诉大家</div>
            <div>您还可以输入<span class="red-color">140</span>个字</div>
        </div>

        <div>
            <textarea name="" id="" cols="30" rows="10" placeholder="请输入内容"></textarea>
        </div>
        <button class="publish">发布</button>
        <!-- <div class="content">
            <p>123456</p>
            <button class="del">删除</button>
        </div> -->
    </div>


    <script src="../js/jquery-1.10.1.min.js"></script>
    <script>
        $(".publish").click(function() {
            $(".wp").append(`<div class="content">
            <p>${$("textarea").val()}</p>
            <button class="del">删除</button>
        </div>`)
        })

        $(".wp").on("click", ".del", function() {
            $(this).parent().remove()
        })
    </script>
</body>

</html>